From: Florian Müllner Date: Sat, 29 Jun 2019 23:04:32 +0000 (+0200) Subject: panel: Relax check for existing signal handler X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~40 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=16ca7a21a7c39406aa27dfa46357e9e5c4197e74;p=gnome-shell.git panel: Relax check for existing signal handler Object.prototype.hasOwnProperty() is more precise than checking for falsiness, for instance the following is true: { foo: undefined }.hasOwnProperty('foo'); However when checking for a handler ID, a more relaxed check is more appropriate, as particularly 0 is not a valid handler ID. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626 --- diff --git a/js/ui/panel.js b/js/ui/panel.js index fcb51950f..6b8e60b19 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -1167,7 +1167,7 @@ class Panel extends St.Widget { } _onMenuSet(indicator) { - if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId')) + if (!indicator.menu || indicator.menu._openChangedId) return; indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',